using CairoMakie # no need to import Makie itselfA data visualization ecosystem for Julia
Marie-Helene Burle
Wednesday, October 26
Many options:
matplotlib.pyplotMain package:
Makie.jl: plots functionalities. Backend needed to render plots into images or vector graphicsBackends:
CairoMakie.jl: vector graphics or high-quality 2D plots (no true 3D). Creates, but does not display plots
GLMakie.jl: true 3D rendering and interactivity in GLFW window (no vector graphics)
WGLMakie.jl: web version of GLMakie (plots rendered in a browser instead of a window)
Load the package
Here, we are using CairoMakie
You can customize a Figure:
Makie uses Colors.jl as a dependency
You can find a list of all named colours here
To use CSS specification (e.g. hex), you need to install Colors.jl explicitly and use its color parsing capabilities
Then, you can create an Axis
Axis with 1 plots:
┗━ Mesh{Tuple{GeometryBasics.Mesh{3, Float32, GeometryBasics.TriangleP{3, Float32, GeometryBasics.PointMeta{3, Float32, Point{3, Float32}, (:normals,), Tuple{Vec{3, Float32}}}}, GeometryBasics.FaceView{GeometryBasics.TriangleP{3, Float32, GeometryBasics.PointMeta{3, Float32, Point{3, Float32}, (:normals,), Tuple{Vec{3, Float32}}}}, GeometryBasics.PointMeta{3, Float32, Point{3, Float32}, (:normals,), Tuple{Vec{3, Float32}}}, GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}, StructArrays.StructVector{GeometryBasics.PointMeta{3, Float32, Point{3, Float32}, (:normals,), Tuple{Vec{3, Float32}}}, NamedTuple{(:position, :normals), Tuple{Vector{Point{3, Float32}}, Vector{Vec{3, Float32}}}}, Int64}, Vector{GeometryBasics.NgonFace{3, GeometryBasics.OffsetInteger{-1, UInt32}}}}}}}
Axis are customizable
Finally, we can add a plot
Of course, there are many plotting functions
Let’s add points to get a smoother line